package com.mowh.multithreading.active.object.active.active.object;

/**
 * @author mowh1gd
 * @create 2023/11/28 16:00
 */
class MakeStringRequest extends MethodRequest<String> {
    private final int count;
    private final char fillChar;

    public MakeStringRequest(Servant servant, FutureResult<String> future, int count, char fillChar) {
        super(servant, future);
        this.count = count;
        this.fillChar = fillChar;
    }

    @Override
    public void execute() {
        Result<String> result = servant.makeString(count, fillChar);//真正执行的是servant实例
        future.setResult(result);//设置真实值
    }
}
